import React, { Component } from 'react';
import { Form, Button, Modal } from 'antd';
const FormItem = Form.Item;

class approvaldetail extends Component {
  constructor() {
    super();
    this.state = {};
  }
  render() {
    const { visible, onCancel, form, pass, reject, approvaldetaildata } = this.props;
    let approvaldetaildatan = approvaldetaildata ? approvaldetaildata : {};
    return (
      <Modal visible={visible} title={this.props.title} onCancel={onCancel} footer={null}>
        <Form>
          <FormItem label="邀请码" labelCol={{ span: 10 }} wrapperCol={{ span: 40 }}>
            <span>{approvaldetaildatan.invitation}</span>
          </FormItem>
          <FormItem label="申请人的组织名称" labelCol={{ span: 10 }} wrapperCol={{ span: 40 }}>
            <span>{approvaldetaildatan.orgName}</span>
          </FormItem>
          <FormItem label="申请加入的网络" labelCol={{ span: 10 }} wrapperCol={{ span: 40 }}>
            <span>{approvaldetaildatan.nickname}</span>
          </FormItem>
          <FormItem label="申请说明" labelCol={{ span: 10 }} wrapperCol={{ span: 40 }}>
            <span>{approvaldetaildatan.remark}</span>
          </FormItem>
        </Form>
        <footer className="detailfooter">
          <Button
            className="datailpass"
            disabled={this.props.approvaledstatus != '待审批' ? 'disabled' : ''}
            onClick={pass.bind(this, this.state.text)}
          >
						通过
          </Button>
          <Button
            className="stopdatail"
            disabled={this.props.approvaledstatus != '待审批' ? 'disabled' : ''}
            onClick={reject.bind(this, this.state.text)}
          >
						拒绝
          </Button>
        </footer>
      </Modal>
    );
  }
}

const Approvaldetail = Form.create()(approvaldetail);
export default Approvaldetail;
